<include file="Public:header"/>
<div class="cat">
<a href="__URL__/add"><img src="__APP__/statics/add_cat.gif" /></a>
<table bordercolor="#DDDFFF" border="1" width="100%" style="border-collapse: collapse" cellpadding="3">
	<tr height="17" align="center">
		<td class="title" width="40">排序</td>
		<td class="title" width="200">配送方式</td>
		<td class="title" width="100">类型</td>
		<td class="title" width="130">首重</td>
		<td class="title" width="130">续重</td>
		<td class="title" width="40">配送</td>
		<td class="title" width="40"></td>
		<td class="title" width="40">删除</td>
		<td class="title">　</td>
	</tr>
<volist name="express" id="express">
	<tr height="20" bgcolor="#F1F5FA" class="cat_list">
		<td width="40"><input type="text" name="n_id[]" style="display:none" value="{$express.id}"><input name="sorting[]" size="10" type="text" value="{$express.sorting}"></td>
		<td width="200" style="font-weight:bold">{$express.ex_name}</td>
<if condition="$express.type eq '2'">
		<td width="100" align="center">按地区价格</td>
<elseif condition="$express.type eq '1'"/>
        <td width="100" align="center">统一价格</td>
<else/>
		<td width="100" align="center">自提</td>
</if>
		<td width="130" align="center">{$express.onefee}元（{$express.one_w}g）</td>
		<td width="130" align="center">{$express.twofee}元（{$express.two_w}g）</td>
<if condition="$express.is_delivery eq 'false'">
		<td width="40" align="center">否</td>
<else/>
        <td width="40" align="center">是</td>
</if>
        <td width="40" align="center"></td>
		<td width="40" align="center"><a href="javascript:;" onclick="deletes({$express.id})"><img alt="删除" src="__APP__/statics/icons/icon_delete.gif"></a></td>
		<td></td>
	</tr>
</volist>
</table>
</div>

<div id="save"><input id="sort" type="button" value="保存排序"></div>

<script>
$(function(){
    $("#sort").click(function(){
              var ship=[];
			  $("[name='n_id[]']").each(function(){
                     ship.push($(this).val()); 
               }); 
			   var sort=[];
			  $("[name='sorting[]']").each(function(){
                     sort.push($(this).val()); 
               }); 
			   $.ajax({
			         type:"POST",
					 url:"__URL__/sorting",
					 dataType:"html",
					 data:{'ship':ship,'sort':sort},
					 success:function(data){
						location.reload();
					 }
			   })
	})
})


function deletes(t){
    var id=t;
	if(confirm('确认删除吗？')) {
       $.ajax({
	       type:"GET",
		   url:"__URL__/remove",
		   dataType:"json",
		   data:{"id":id},
		   success:function(data){
               if(data=='1'){
				   jSuccess("<strong>删除成功！</strong>",{TimeShown : 500,VerticalPosition : 'center',HorizontalPosition : 'center',onClosed:function(){location.reload();}})
			  }else{
			      jError("<strong>删除失败!请重试</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center'});
			 }
		   }
	   })

	}
}
</script>


</body>
</html>